#include<stdio.h>
#define MAX 50
int main()
{
    int i, num;
    int Chinses[MAX], Math[MAX], English[MAX];
    long StudentID[MAX];
    float average[MAX];
    printf("please input the number of students: ");
    scanf_s("%d", &num);
    printf("please input a StudentID and three scores:\n");
    printf("      StudentID     Chinese    Math     English\n");
    for (i = 0; i < num; i++)
    {
        printf("No.%d>", i + 1);
        scanf_s("%ld%d%d%d", &StudentID[i], &Chinses[i], &Math[i], &English[i]);
        average[i] = (Chinses[i] + Math[i] + English[i]) / 3.0f;
    }

    // Using fputs instead of puts
    fputs("\nStudentID   Chinese   Math   English   Average\n", stdout);
    for (i = 0; i < num; i++)
        printf("%10ld%9d%7d%9d%10.2f\n", StudentID[i], Chinses[i], Math[i], English[i], average[i]);

    return 0;
}
